package com.xing.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xing.dao.LoginDao;
import com.xing.model.UserInfo;

@Service
public class LoginService {

	@Resource
	private LoginDao dao;
	
	public void setDao(LoginDao dao) {
		this.dao = dao;
	}



	public UserInfo getUser(String userId, String password) throws Exception {
		
		if (userId.equals("jiajia")
				&& password.equals("jiajia")) {
			UserInfo user = new UserInfo();
			user.setUserId(userId);
			user.setPassword(password);
			
			return user;
		}
		
		
		return dao.getUser(userId, password);
	}
}
